var e = require('../../../@babel/runtime/helpers/regeneratorRuntime'),
  t = require('../../../@babel/runtime/helpers/asyncToGenerator'),
  n = getApp();
Page({
  data: { goods_id: 0, page: 1, list: [], noMore: !1 },
  onLoad: function (e) {
    this.setData({ goods_id: e.id }), this.getList();
  },
  getList: function () {
    var o = this;
    return t(
      e().mark(function t() {
        var i, a, r, s;
        return e().wrap(function (e) {
          for (;;)
            switch ((e.prev = e.next)) {
              case 0:
                if (((i = o.data), (a = i.goods_id), (r = i.page), !i.noMore)) {
                  e.next = 3;
                  break;
                }
                return e.abrupt('return');
              case 3:
                return (
                  (e.next = 5),
                  n.$api.goods.reviewList({ goods_id: a, page: r })
                );
              case 5:
                (s = e.sent),
                  o.setData({
                    list: o.data.list.concat(s.list),
                    is_show_btn: s.material_info.is_show_btn || 0,
                    page: s.list.length ? r + 1 : r,
                    noMore: !s.list.length,
                  }),
                  console.log(s);
              case 8:
              case 'end':
                return e.stop();
            }
        }, t);
      }),
    )();
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {
    this.getList();
  },
  onShareAppMessage: function () {},
});
